package com.azt.api.pojo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.commons.lang.StringUtils;

import com.azt.utils.FormatUtil;

@Table(name = "u_prize_record")
public class PrizeRecord implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 用户ID
     */
    private Integer userId;

	/**
     * 奖品ID
     */
    private Integer prizeId;

    /**
     * 联系人
     */
    private String contactName;

    /**
     * 联系电话
     */
    private String contactTel;

    /**
     * 邮寄地址
     */
    private String contactAdd;

    /**
     * 状态 0未寄出1已寄出2已充值
     */
    private Integer state;

    /**
     * 快递公司
     */
    private Integer courierCompanyId;

	/**
     * 快递单号
     */
    private String courierNum;

    public String getGiftName() {
        return giftName;
    }

    public void setGiftName(String giftName) {
        this.giftName = giftName;
    }

    /**
     * 消耗积分
     */
    private Integer useScore;

    /**
     * 操作人id
     */
    private Integer operateid;

    private Date createtime;

    private Date updatetime;

	//关联奖品表
    @Transient
    private PrizeSet prizeSet;
    //公司名称
    @Transient
    private String companyName;
	//快递公司名称
    @Transient
    private String devCompanyName;
    //用户user的手机
	@Transient
    private String mobile;
	//用户user的邮箱
    @Transient
    private String email;
    //中奖时间
    @Transient
    private Date recordTime;
    @Transient
    private String giftName;
    //隐藏的用户名或邮箱
    @Transient
    private String hiddenUserName;

    @Transient
    private Integer type;

	/**
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取用户ID
     *
     * @return userId - 用户ID
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 设置用户ID
     *
     * @param userId 用户ID
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取奖品ID
     *
     * @return prizeId - 奖品ID
     */
    public Integer getPrizeId() {
        return prizeId;
    }

    /**
     * 设置奖品ID
     *
     * @param prizeId 奖品ID
     */
    public void setPrizeId(Integer prizeId) {
        this.prizeId = prizeId;
    }

    /**
     * 获取联系人
     *
     * @return contactName - 联系人
     */
    public String getContactName() {
        return contactName;
    }

    /**
     * 设置联系人
     *
     * @param contactName 联系人
     */
    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    /**
     * 获取联系电话
     *
     * @return contactTel - 联系电话
     */
    public String getContactTel() {
        return contactTel;
    }

    /**
     * 设置联系电话
     *
     * @param contactTel 联系电话
     */
    public void setContactTel(String contactTel) {
        this.contactTel = contactTel;
    }

    /**
     * 获取邮寄地址
     *
     * @return contactAdd - 邮寄地址
     */
    public String getContactAdd() {
        return contactAdd;
    }

    /**
     * 设置邮寄地址
     *
     * @param contactAdd 邮寄地址
     */
    public void setContactAdd(String contactAdd) {
        this.contactAdd = contactAdd;
    }

  
    /**
     * 获取状态 0未寄出1已寄出2已充值
     *
     * @return status - 状态 0未寄出1已寄出2已充值
     */
    public Integer getState() {
        return state;
    }

    /**
     * 设置状态 0未寄出1已寄出2已充值
     *
     * @param status 状态 0未寄出1已寄出2已充值
     */
    public void setState(Integer state) {
        this.state = state;
    }

    /**
     * 获取快递公司
     *
     * @return courierCompany - 快递公司
     */
    public Integer getCourierCompanyId() {
        return courierCompanyId;
    }

    /**
     * 设置快递公司
     *
     * @param courierCompany 快递公司
     */
    public void setCourierCompanyId(Integer courierCompanyId) {
		this.courierCompanyId = courierCompanyId;
	}
    /**
     * 获取快递单号
     *
     * @return courierNum - 快递单号
     */
    public String getCourierNum() {
        return courierNum;
    }

    /**
     * 设置快递单号
     *
     * @param courierNum 快递单号
     */
    public void setCourierNum(String courierNum) {
        this.courierNum = courierNum;
    }

    /**
     * 获取消耗积分
     *
     * @return use_score - 消耗积分
     */
    public Integer getUseScore() {
        return useScore;
    }

    /**
     * 设置消耗积分
     *
     * @param use_score 消耗积分
     */
    public void setUseScore(Integer useScore) {
        this.useScore = useScore;
    }

    /**
     * 获取操作人id
     *
     * @return operateid - 操作人id
     */
    public Integer getOperateid() {
        return operateid;
    }

    /**
     * 设置操作人id
     *
     * @param operateid 操作人id
     */
    public void setOperateid(Integer operateid) {
        this.operateid = operateid;
    }

    /**
     * @return createtime
     */
    public Date getCreatetime() {
        return createtime;
    }

    /**
     * @param createtime
     */
    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    /**
     * @return updatetime
     */
    public Date getUpdatetime() {
        return updatetime;
    }

    /**
     * @param updatetime
     */
    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }
    
    public PrizeSet getPrizeSet() {
		return prizeSet;
	}

	public void setPrizeSet(PrizeSet prizeSet) {
		this.prizeSet = prizeSet;
	}
	
    public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getDevCompanyName() {
		return devCompanyName;
	}

	public void setDevCompanyName(String devCompanyName) {
		this.devCompanyName = devCompanyName;
	}
    public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	
    public String getHiddenUserName() {
    	String hiddenMobile = FormatUtil.getHideMobile(mobile);
		String hiddenEmail = FormatUtil.getHiddenEmail(email);
		return StringUtils.isNotBlank(hiddenMobile) ? hiddenMobile : hiddenEmail;
	}

	public void setHiddenUserName(String hiddenUserName) {
		this.hiddenUserName = hiddenUserName;
	}
	
    public Date getRecordTime() {
		return recordTime;
	}
    
	public void setRecordTime(Date recordTime) {
		this.recordTime = recordTime;
	}

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
}